from django.test import TestCase

# Create your tests here.
{'api_version': 'apps/v1',
 'items': [
     {'api_version': None,
            'kind': None,
            'metadata': {'annotations': {'deployment.kubernetes.io/revision': '1'},
                         'cluster_name': None,
                         'creation_timestamp': datetime.datetime(2021, 6, 6, 15, 44, 53, tzinfo=tzutc()),
                         'deletion_grace_period_seconds': None,
                         'deletion_timestamp': None,
                         'finalizers': None,
                         'generate_name': None,
                         'generation': 1,
                         'labels': {'k8s-app': 'kubeedge-pi-redis'},
                         'managed_fields': [{'api_version': 'apps/v1',
                                             'fields_type': 'FieldsV1',
                                             'fields_v1': {'f:metadata': {'f:labels': {'.': {},
                                                                                       'f:k8s-app': {}}},
                                                           'f:spec': {'f:progressDeadlineSeconds': {},
                                                                      'f:replicas': {},
                                                                      'f:revisionHistoryLimit': {},
                                                                      'f:selector': {'f:matchLabels': {'.': {},
                                                                                                       'f:k8s-app': {}}},
                                                                      'f:strategy': {'f:rollingUpdate': {'.': {},
                                                                                                         'f:maxSurge': {},
                                                                                                         'f:maxUnavailable': {}},
                                                                                     'f:type': {}},
                                                                      'f:template': {'f:metadata': {'f:labels': {'.': {},
                                                                                                                 'f:k8s-app': {}}},
                                                                                     'f:spec': {'f:containers': {'k:{"name":"kubeedge-pi-redis-backend"}': {'.': {},
                                                                                                                                                            'f:image': {},
                                                                                                                                                            'f:imagePullPolicy': {},
                                                                                                                                                            'f:name': {},
                                                                                                                                                            'f:ports': {'.': {},
                                                                                                                                                                        'k:{"containerPort":80,"protocol":"TCP"}': {'.': {},
                                                                                                                                                                                                                    'f:containerPort': {},
                                                                                                                                                                                                                    'f:hostPort': {},
                                                                                                                                                                                                                    'f:protocol': {}}},
                                                                                                                                                            'f:resources': {},
                                                                                                                                                            'f:terminationMessagePath': {},
                                                                                                                                                            'f:terminationMessagePolicy': {}},
                                                                                                                 'k:{"name":"kubeedge-pi-redis-frontend"}': {'.': {},
                                                                                                                                                             'f:image': {},
                                                                                                                                                             'f:imagePullPolicy': {},
                                                                                                                                                             'f:name': {},
                                                                                                                                                             'f:ports': {'.': {},
                                                                                                                                                                         'k:{"containerPort":6379,"protocol":"TCP"}': {'.': {},
                                                                                                                                                                                                                       'f:containerPort': {},
                                                                                                                                                                                                                       'f:hostPort': {},
                                                                                                                                                                                                                       'f:protocol': {}}},
                                                                                                                                                             'f:resources': {},
                                                                                                                                                             'f:terminationMessagePath': {},
                                                                                                                                                             'f:terminationMessagePolicy': {}}},
                                                                                                'f:dnsPolicy': {},
                                                                                                'f:restartPolicy': {},
                                                                                                'f:schedulerName': {},
                                                                                                'f:securityContext': {},
                                                                                                'f:terminationGracePeriodSeconds': {}}}}},
                                             'manager': 'OpenAPI-Generator',
                                             'operation': 'Update',
                                             'time': datetime.datetime(2021, 6, 6, 15, 44, 53, tzinfo=tzutc())},
                                            {'api_version': 'apps/v1',
                                             'fields_type': 'FieldsV1',
                                             'fields_v1': {'f:metadata': {'f:annotations': {'.': {},
                                                                                            'f:deployment.kubernetes.io/revision': {}}},
                                                           'f:status': {'f:availableReplicas': {},
                                                                        'f:conditions': {'.': {},
                                                                                         'k:{"type":"Available"}': {'.': {},
                                                                                                                    'f:lastTransitionTime': {},
                                                                                                                    'f:lastUpdateTime': {},
                                                                                                                    'f:message': {},
                                                                                                                    'f:reason': {},
                                                                                                                    'f:status': {},
                                                                                                                    'f:type': {}},
                                                                                         'k:{"type":"Progressing"}': {'.': {},
                                                                                                                      'f:lastTransitionTime': {},
                                                                                                                      'f:lastUpdateTime': {},
                                                                                                                      'f:message': {},
                                                                                                                      'f:reason': {},
                                                                                                                      'f:status': {},
                                                                                                                      'f:type': {}}},
                                                                        'f:observedGeneration': {},
                                                                        'f:readyReplicas': {},
                                                                        'f:replicas': {},
                                                                        'f:updatedReplicas': {}}},
                                             'manager': 'kube-controller-manager',
                                             'operation': 'Update',
                                             'time': datetime.datetime(2021, 6, 6, 15, 44, 55, tzinfo=tzutc())}],
                         'name': 'kubeedge-pi-redis',
                         'namespace': 'default',
                         'owner_references': None,
                         'resource_version': '274254',
                         'self_link': '/apis/apps/v1/namespaces/default/deployments/kubeedge-pi-redis',
                         'uid': '883df8b1-1759-450f-bb48-717f288e0003'},
            'spec': {'min_ready_seconds': None,
                     'paused': None,
                     'progress_deadline_seconds': 600,
                     'replicas': 1,
                     'revision_history_limit': 10,
                     'selector': {'match_expressions': None,
                                  'match_labels': {'k8s-app': 'kubeedge-pi-redis'}},
                     'strategy': {'rolling_update': {'max_surge': '25%',
                                                     'max_unavailable': '25%'},
                                  'type': 'RollingUpdate'},
                     'template': {'metadata': {'annotations': None,
                                               'cluster_name': None,
                                               'creation_timestamp': None,
                                               'deletion_grace_period_seconds': None,
                                               'deletion_timestamp': None,
                                               'finalizers': None,
                                               'generate_name': None,
                                               'generation': None,
                                               'labels': {'k8s-app': 'kubeedge-pi-redis'},
                                               'managed_fields': None,
                                               'name': None,
                                               'namespace': None,
                                               'owner_references': None,
                                               'resource_version': None,
                                               'self_link': None,
                                               'uid': None},
                                  'spec': {'active_deadline_seconds': None,
                                           'affinity': None,
                                           'automount_service_account_token': None,
                                           'containers': [{'args': None,
                                                           'command': None,
                                                           'env': None,
                                                           'env_from': None,
                                                           'image': 'nginx:1.15.5',
                                                           'image_pull_policy': 'IfNotPresent',
                                                           'lifecycle': None,
                                                           'liveness_probe': None,
                                                           'name': 'kubeedge-pi-redis-backend',
                                                           'ports': [{'container_port': 80,
                                                                      'host_ip': None,
                                                                      'host_port': 8086,
                                                                      'name': None,
                                                                      'protocol': 'TCP'}],
                                                           'readiness_probe': None,
                                                           'resources': {'limits': None,
                                                                         'requests': None},
                                                           'security_context': None,
                                                           'startup_probe': None,
                                                           'stdin': None,
                                                           'stdin_once': None,
                                                           'termination_message_path': '/dev/termination-log',
                                                           'termination_message_policy': 'File',
                                                           'tty': None,
                                                           'volume_devices': None,
                                                           'volume_mounts': None,
                                                           'working_dir': None},
                                                          {'args': None,
                                                           'command': None,
                                                           'env': None,
                                                           'env_from': None,
                                                           'image': 'redis:alpine3.12',
                                                           'image_pull_policy': 'IfNotPresent',
                                                           'lifecycle': None,
                                                           'liveness_probe': None,
                                                           'name': 'kubeedge-pi-redis-frontend',
                                                           'ports': [{'container_port': 6379,
                                                                      'host_ip': None,
                                                                      'host_port': 8087,
                                                                      'name': None,
                                                                      'protocol': 'TCP'}],
                                                           'readiness_probe': None,
                                                           'resources': {'limits': None,
                                                                         'requests': None},
                                                           'security_context': None,
                                                           'startup_probe': None,
                                                           'stdin': None,
                                                           'stdin_once': None,
                                                           'termination_message_path': '/dev/termination-log',
                                                           'termination_message_policy': 'File',
                                                           'tty': None,
                                                           'volume_devices': None,
                                                           'volume_mounts': None,
                                                           'working_dir': None}],
                                           'dns_config': None,
                                           'dns_policy': 'ClusterFirst',
                                           'enable_service_links': None,
                                           'ephemeral_containers': None,
                                           'host_aliases': None,
                                           'host_ipc': None,
                                           'host_network': None,
                                           'host_pid': None,
                                           'hostname': None,
                                           'image_pull_secrets': None,
                                           'init_containers': None,
                                           'node_name': None,
                                           'node_selector': None,
                                           'overhead': None,
                                           'preemption_policy': None,
                                           'priority': None,
                                           'priority_class_name': None,
                                           'readiness_gates': None,
                                           'restart_policy': 'Always',
                                           'runtime_class_name': None,
                                           'scheduler_name': 'default-scheduler',
                                           'security_context': {'fs_group': None,
                                                                'run_as_group': None,
                                                                'run_as_non_root': None,
                                                                'run_as_user': None,
                                                                'se_linux_options': None,
                                                                'supplemental_groups': None,
                                                                'sysctls': None,
                                                                'windows_options': None},
                                           'service_account': None,
                                           'service_account_name': None,
                                           'share_process_namespace': None,
                                           'subdomain': None,
                                           'termination_grace_period_seconds': 30,
                                           'tolerations': None,
                                           'topology_spread_constraints': None,
                                           'volumes': None}}},
            'status': {'available_replicas': 1,
                       'collision_count': None,
                       'conditions': [{'last_transition_time': datetime.datetime(2021, 6, 6, 15, 44, 55, tzinfo=tzutc()),
                                       'last_update_time': datetime.datetime(2021, 6, 6, 15, 44, 55, tzinfo=tzutc()),
                                       'message': 'Deployment has minimum '
                                                  'availability.',
                                       'reason': 'MinimumReplicasAvailable',
                                       'status': 'True',
                                       'type': 'Available'},
                                      {'last_transition_time': datetime.datetime(2021, 6, 6, 15, 44, 53, tzinfo=tzutc()),
                                       'last_update_time': datetime.datetime(2021, 6, 6, 15, 44, 55, tzinfo=tzutc()),
                                       'message': 'ReplicaSet '
                                                  '"kubeedge-pi-redis-7d499b899b" '
                                                  'has successfully '
                                                  'progressed.',
                                       'reason': 'NewReplicaSetAvailable',
                                       'status': 'True',
                                       'type': 'Progressing'}],
                       'observed_generation': 1,
                       'ready_replicas': 1,
                       'replicas': 1,
                       'unavailable_replicas': None,
                       'updated_replicas': 1}},
           {'api_version': None,
            'kind': None,
            'metadata': {'annotations': {'deployment.kubernetes.io/revision': '1'},
                         'cluster_name': None,
                         'creation_timestamp': datetime.datetime(2021, 6, 6, 16, 37, 10, tzinfo=tzutc()),
                         'deletion_grace_period_seconds': None,
                         'deletion_timestamp': None,
                         'finalizers': None,
                         'generate_name': None,
                         'generation': 1,
                         'labels': {'app': 'nginx'},
                         'managed_fields': [{'api_version': 'apps/v1',
                                             'fields_type': 'FieldsV1',
                                             'fields_v1': {'f:metadata': {'f:labels': {'.': {},
                                                                                       'f:app': {}}},
                                                           'f:spec': {'f:progressDeadlineSeconds': {},
                                                                      'f:replicas': {},
                                                                      'f:revisionHistoryLimit': {},
                                                                      'f:selector': {'f:matchLabels': {'.': {},
                                                                                                       'f:app': {}}},
                                                                      'f:strategy': {'f:rollingUpdate': {'.': {},
                                                                                                         'f:maxSurge': {},
                                                                                                         'f:maxUnavailable': {}},
                                                                                     'f:type': {}},
                                                                      'f:template': {'f:metadata': {'f:labels': {'.': {},
                                                                                                                 'f:app': {}}},
                                                                                     'f:spec': {'f:containers': {'k:{"name":"nginx"}': {'.': {},
                                                                                                                                        'f:image': {},
                                                                                                                                        'f:imagePullPolicy': {},
                                                                                                                                        'f:name': {},
                                                                                                                                        'f:ports': {'.': {},
                                                                                                                                                    'k:{"containerPort":80,"protocol":"TCP"}': {'.': {},
                                                                                                                                                                                                'f:containerPort': {},
                                                                                                                                                                                                'f:protocol': {}}},
                                                                                                                                        'f:resources': {},
                                                                                                                                        'f:terminationMessagePath': {},
                                                                                                                                        'f:terminationMessagePolicy': {}}},
                                                                                                'f:dnsPolicy': {},
                                                                                                'f:restartPolicy': {},
                                                                                                'f:schedulerName': {},
                                                                                                'f:securityContext': {},
                                                                                                'f:terminationGracePeriodSeconds': {}}}}},
                                             'manager': 'kubectl-create',
                                             'operation': 'Update',
                                             'time': datetime.datetime(2021, 6, 6, 16, 37, 10, tzinfo=tzutc())},
                                            {'api_version': 'apps/v1',
                                             'fields_type': 'FieldsV1',
                                             'fields_v1': {'f:metadata': {'f:annotations': {'.': {},
                                                                                            'f:deployment.kubernetes.io/revision': {}}},
                                                           'f:status': {'f:availableReplicas': {},
                                                                        'f:conditions': {'.': {},
                                                                                         'k:{"type":"Available"}': {'.': {},
                                                                                                                    'f:lastTransitionTime': {},
                                                                                                                    'f:lastUpdateTime': {},
                                                                                                                    'f:message': {},
                                                                                                                    'f:reason': {},
                                                                                                                    'f:status': {},
                                                                                                                    'f:type': {}},
                                                                                         'k:{"type":"Progressing"}': {'.': {},
                                                                                                                      'f:lastTransitionTime': {},
                                                                                                                      'f:lastUpdateTime': {},
                                                                                                                      'f:message': {},
                                                                                                                      'f:reason': {},
                                                                                                                      'f:status': {},
                                                                                                                      'f:type': {}}},
                                                                        'f:observedGeneration': {},
                                                                        'f:readyReplicas': {},
                                                                        'f:replicas': {},
                                                                        'f:updatedReplicas': {}}},
                                             'manager': 'kube-controller-manager',
                                             'operation': 'Update',
                                             'time': datetime.datetime(2021, 6, 6, 16, 37, 20, tzinfo=tzutc())}],
                         'name': 'nginx-deployment',
                         'namespace': 'default',
                         'owner_references': None,
                         'resource_version': '283018',
                         'self_link': '/apis/apps/v1/namespaces/default/deployments/nginx-deployment',
                         'uid': '12ac2265-cdf3-48f6-b6ca-240d65215455'},
            'spec': {'min_ready_seconds': None,
                     'paused': None,
                     'progress_deadline_seconds': 600,
                     'replicas': 3,
                     'revision_history_limit': 10,
                     'selector': {'match_expressions': None,
                                  'match_labels': {'app': 'nginx'}},
                     'strategy': {'rolling_update': {'max_surge': '25%',
                                                     'max_unavailable': '25%'},
                                  'type': 'RollingUpdate'},
                     'template': {'metadata': {'annotations': None,
                                               'cluster_name': None,
                                               'creation_timestamp': None,
                                               'deletion_grace_period_seconds': None,
                                               'deletion_timestamp': None,
                                               'finalizers': None,
                                               'generate_name': None,
                                               'generation': None,
                                               'labels': {'app': 'nginx'},
                                               'managed_fields': None,
                                               'name': None,
                                               'namespace': None,
                                               'owner_references': None,
                                               'resource_version': None,
                                               'self_link': None,
                                               'uid': None},
                                  'spec': {'active_deadline_seconds': None,
                                           'affinity': None,
                                           'automount_service_account_token': None,
                                           'containers': [{'args': None,
                                                           'command': None,
                                                           'env': None,
                                                           'env_from': None,
                                                           'image': 'nginx:1.15.4',
                                                           'image_pull_policy': 'IfNotPresent',
                                                           'lifecycle': None,
                                                           'liveness_probe': None,
                                                           'name': 'nginx',
                                                           'ports': [{'container_port': 80,
                                                                      'host_ip': None,
                                                                      'host_port': None,
                                                                      'name': None,
                                                                      'protocol': 'TCP'}],
                                                           'readiness_probe': None,
                                                           'resources': {'limits': None,
                                                                         'requests': None},
                                                           'security_context': None,
                                                           'startup_probe': None,
                                                           'stdin': None,
                                                           'stdin_once': None,
                                                           'termination_message_path': '/dev/termination-log',
                                                           'termination_message_policy': 'File',
                                                           'tty': None,
                                                           'volume_devices': None,
                                                           'volume_mounts': None,
                                                           'working_dir': None}],
                                           'dns_config': None,
                                           'dns_policy': 'ClusterFirst',
                                           'enable_service_links': None,
                                           'ephemeral_containers': None,
                                           'host_aliases': None,
                                           'host_ipc': None,
                                           'host_network': None,
                                           'host_pid': None,
                                           'hostname': None,
                                           'image_pull_secrets': None,
                                           'init_containers': None,
                                           'node_name': None,
                                           'node_selector': None,
                                           'overhead': None,
                                           'preemption_policy': None,
                                           'priority': None,
                                           'priority_class_name': None,
                                           'readiness_gates': None,
                                           'restart_policy': 'Always',
                                           'runtime_class_name': None,
                                           'scheduler_name': 'default-scheduler',
                                           'security_context': {'fs_group': None,
                                                                'run_as_group': None,
                                                                'run_as_non_root': None,
                                                                'run_as_user': None,
                                                                'se_linux_options': None,
                                                                'supplemental_groups': None,
                                                                'sysctls': None,
                                                                'windows_options': None},
                                           'service_account': None,
                                           'service_account_name': None,
                                           'share_process_namespace': None,
                                           'subdomain': None,
                                           'termination_grace_period_seconds': 30,
                                           'tolerations': None,
                                           'topology_spread_constraints': None,
                                           'volumes': None}}},
            'status': {'available_replicas': 3,
                       'collision_count': None,
                       'conditions': [{'last_transition_time': datetime.datetime(2021, 6, 6, 16, 37, 20, tzinfo=tzutc()),
                                       'last_update_time': datetime.datetime(2021, 6, 6, 16, 37, 20, tzinfo=tzutc()),
                                       'message': 'Deployment has minimum '
                                                  'availability.',
                                       'reason': 'MinimumReplicasAvailable',
                                       'status': 'True',
                                       'type': 'Available'},
                                      {'last_transition_time': datetime.datetime(2021, 6, 6, 16, 37, 10, tzinfo=tzutc()),
                                       'last_update_time': datetime.datetime(2021, 6, 6, 16, 37, 20, tzinfo=tzutc()),
                                       'message': 'ReplicaSet '
                                                  '"nginx-deployment-746ccc65d8" '
                                                  'has successfully '
                                                  'progressed.',
                                       'reason': 'NewReplicaSetAvailable',
                                       'status': 'True',
                                       'type': 'Progressing'}],
                       'observed_generation': 1,
                       'ready_replicas': 3,
                       'replicas': 3,
                       'unavailable_replicas': None,
                       'updated_replicas': 3}}],
 'kind': 'DeploymentList',
 'metadata': {'_continue': None,
              'remaining_item_count': None,
              'resource_version': '348518',
              'self_link': '/apis/apps/v1/namespaces/default/deployments'}}